If the delete key is pressed while a message/MPRIS indicator is focused
GNOME now asks whether the message/MPRIS indicator is closable.
If yes it will be closed but if not it won't be closed.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5536
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2323>
if (keysym == Clutter.KEY_Delete ||
keysym == Clutter.KEY_KP_Delete) {
- this.close();
- return Clutter.EVENT_STOP;
+ if (this.canClose()) {
+ this.close();
+ return Clutter.EVENT_STOP;
+ }
}
return super.vfunc_key_press_event(keyEvent);
}